extends Node2D


func _ready() -> void:
	pass

func _process(_delta: float) -> void:
	pass

func _input(_event) -> void:
	if _event is InputEventKey:
		print("键盘事件")

		if _event.is_echo():
			print("持续按下键盘")
		elif _event.is_pressed():
			print("按下了键盘", OS.get_keycode_string(_event.keycode))
			print("按下了键盘", OS.get_keycode_string(_event.key_label))
		elif _event.is_released():
			print("抬起了键盘")
			if _event.keycode == KEY_W:
				Input.mouse_mode = Input.MOUSE_MODE_VISIBLE # 显示鼠标
			elif _event.keycode == KEY_E:
				Input.mouse_mode = Input.MOUSE_MODE_HIDDEN # 隐藏鼠标
			elif _event.keycode == KEY_R:
				Input.mouse_mode = Input.MOUSE_MODE_CAPTURED # 捕获鼠标在屏幕中心并隐藏
			elif _event.keycode == KEY_T:
				Input.mouse_mode = Input.MOUSE_MODE_CONFINED # 捕获鼠标在屏幕中并显示
			elif _event.keycode == KEY_Y:
				Input.mouse_mode = Input.MOUSE_MODE_CONFINED_HIDDEN # 捕获鼠标在屏幕中并隐藏
			elif _event.keycode == KEY_U:
				Input.mouse_mode = Input.MOUSE_MODE_MAX # 模式的最大值，并没有什么作用
	elif _event is InputEventMouseButton:
		if _event.pressed:
			print("按下鼠标按键", _event.button_index)
		else:
			print("抬起了鼠标按键")
	elif _event is InputEventMouseMotion:
		print("笔或者鼠标移动事件")
		print("鼠标位置：", _event.position)
		print("鼠标相对位置：", _event.relative)
		print("鼠标速度（像素每秒）", _event.velocity)
	elif _event is InputEventJoypadButton:
		print("手柄事件")
	elif _event is InputEventJoypadMotion:
		print("手柄摇杆事件")
	elif _event is InputEventScreenTouch:
		print("触摸屏事件")
	elif _event is InputEventScreenDrag:
		print("触摸屏拖拽事件")
	elif _event is InputEventAction:
		print("动作事件")
	elif _event is InputEventGesture:
		print("手势事件")
	elif _event is InputEventPanGesture:
		print("手势平移事件")
	elif _event is InputEventPanGesture:
		print("手势缩放事件")
	elif _event is InputEventPanGesture:
		print("手势旋转事件")
	elif _event is InputEventPanGesture:
		print("手势双指旋转事件")
	elif _event is InputEventPanGesture:
		print("手势双指缩放事件")
	
	pass
